Optimal. Leaf size=145 \[ \frac {2 a^2 \cos \left (e-\frac {c f}{d}\right ) \text {CosIntegral}\left (\frac {c f}{d}+f x\right )}{d}+\frac {a^2 \cos \left (2 e-\frac {2 c f}{d}\right ) \text {CosIntegral}\left (\frac {2 c f}{d}+2 f x\right )}{2 d}+\frac {3 a^2 \log (c+d x)}{2 d}-\frac {2 a^2 \sin \left (e-\frac {c f}{d}\right ) \text {Si}\left (\frac {c f}{d}+f x\right )}{d}-\frac {a^2 \sin \left (2 e-\frac {2 c f}{d}\right ) \text {Si}\left (\frac {2 c f}{d}+2 f x\right )}{2 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.23, antiderivative size = 145, normalized size of antiderivative = 1.00, number of steps
used = 9, number of rules used = 5, integrand size = 20, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.250, Rules used = {3399, 3393,
3384, 3380, 3383} \begin {gather*} \frac {2 a^2 \text {CosIntegral}\left (\frac {c f}{d}+f x\right ) \cos \left (e-\frac {c f}{d}\right )}{d}+\frac {a^2 \text {CosIntegral}\left (\frac {2 c f}{d}+2 f x\right ) \cos \left (2 e-\frac {2 c f}{d}\right )}{2 d}-\frac {2 a^2 \sin \left (e-\frac {c f}{d}\right ) \text {Si}\left (x f+\frac {c f}{d}\right )}{d}-\frac {a^2 \sin \left (2 e-\frac {2 c f}{d}\right ) \text {Si}\left (2 x f+\frac {2 c f}{d}\right )}{2 d}+\frac {3 a^2 \log (c+d x)}{2 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 3380
Rule 3383
Rule 3384
Rule 3393
Rule 3399
Rubi steps
\begin {align*} \int \frac {(a+a \cos (e+f x))^2}{c+d x} \, dx &=\left (4 a^2\right ) \int \frac {\sin ^4\left (\frac {e+\pi }{2}+\frac {f x}{2}\right )}{c+d x} \, dx\\ &=\left (4 a^2\right ) \int \left (\frac {3}{8 (c+d x)}+\frac {\cos (e+f x)}{2 (c+d x)}+\frac {\cos (2 e+2 f x)}{8 (c+d x)}\right ) \, dx\\ &=\frac {3 a^2 \log (c+d x)}{2 d}+\frac {1}{2} a^2 \int \frac {\cos (2 e+2 f x)}{c+d x} \, dx+\left (2 a^2\right ) \int \frac {\cos (e+f x)}{c+d x} \, dx\\ &=\frac {3 a^2 \log (c+d x)}{2 d}+\frac {1}{2} \left (a^2 \cos \left (2 e-\frac {2 c f}{d}\right )\right ) \int \frac {\cos \left (\frac {2 c f}{d}+2 f x\right )}{c+d x} \, dx+\left (2 a^2 \cos \left (e-\frac {c f}{d}\right )\right ) \int \frac {\cos \left (\frac {c f}{d}+f x\right )}{c+d x} \, dx-\frac {1}{2} \left (a^2 \sin \left (2 e-\frac {2 c f}{d}\right )\right ) \int \frac {\sin \left (\frac {2 c f}{d}+2 f x\right )}{c+d x} \, dx-\left (2 a^2 \sin \left (e-\frac {c f}{d}\right )\right ) \int \frac {\sin \left (\frac {c f}{d}+f x\right )}{c+d x} \, dx\\ &=\frac {2 a^2 \cos \left (e-\frac {c f}{d}\right ) \text {Ci}\left (\frac {c f}{d}+f x\right )}{d}+\frac {a^2 \cos \left (2 e-\frac {2 c f}{d}\right ) \text {Ci}\left (\frac {2 c f}{d}+2 f x\right )}{2 d}+\frac {3 a^2 \log (c+d x)}{2 d}-\frac {2 a^2 \sin \left (e-\frac {c f}{d}\right ) \text {Si}\left (\frac {c f}{d}+f x\right )}{d}-\frac {a^2 \sin \left (2 e-\frac {2 c f}{d}\right ) \text {Si}\left (\frac {2 c f}{d}+2 f x\right )}{2 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.13, size = 114, normalized size = 0.79 \begin {gather*} \frac {a^2 \left (4 \cos \left (e-\frac {c f}{d}\right ) \text {CosIntegral}\left (f \left (\frac {c}{d}+x\right )\right )+\cos \left (2 e-\frac {2 c f}{d}\right ) \text {CosIntegral}\left (\frac {2 f (c+d x)}{d}\right )+3 \log (c+d x)-4 \sin \left (e-\frac {c f}{d}\right ) \text {Si}\left (f \left (\frac {c}{d}+x\right )\right )-\sin \left (2 e-\frac {2 c f}{d}\right ) \text {Si}\left (\frac {2 f (c+d x)}{d}\right )\right )}{2 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.10, size = 197, normalized size = 1.36
method | result | size |
derivativedivides | \(\frac {\frac {f \,a^{2} \left (\frac {2 \sinIntegral \left (2 f x +2 e +\frac {2 c f -2 d e}{d}\right ) \sin \left (\frac {2 c f -2 d e}{d}\right )}{d}+\frac {2 \cosineIntegral \left (2 f x +2 e +\frac {2 c f -2 d e}{d}\right ) \cos \left (\frac {2 c f -2 d e}{d}\right )}{d}\right )}{4}+\frac {3 f \,a^{2} \ln \left (c f -d e +d \left (f x +e \right )\right )}{2 d}+2 f \,a^{2} \left (\frac {\sinIntegral \left (f x +e +\frac {c f -d e}{d}\right ) \sin \left (\frac {c f -d e}{d}\right )}{d}+\frac {\cosineIntegral \left (f x +e +\frac {c f -d e}{d}\right ) \cos \left (\frac {c f -d e}{d}\right )}{d}\right )}{f}\) | \(197\) |
default | \(\frac {\frac {f \,a^{2} \left (\frac {2 \sinIntegral \left (2 f x +2 e +\frac {2 c f -2 d e}{d}\right ) \sin \left (\frac {2 c f -2 d e}{d}\right )}{d}+\frac {2 \cosineIntegral \left (2 f x +2 e +\frac {2 c f -2 d e}{d}\right ) \cos \left (\frac {2 c f -2 d e}{d}\right )}{d}\right )}{4}+\frac {3 f \,a^{2} \ln \left (c f -d e +d \left (f x +e \right )\right )}{2 d}+2 f \,a^{2} \left (\frac {\sinIntegral \left (f x +e +\frac {c f -d e}{d}\right ) \sin \left (\frac {c f -d e}{d}\right )}{d}+\frac {\cosineIntegral \left (f x +e +\frac {c f -d e}{d}\right ) \cos \left (\frac {c f -d e}{d}\right )}{d}\right )}{f}\) | \(197\) |
risch | \(-\frac {a^{2} {\mathrm e}^{\frac {i \left (c f -d e \right )}{d}} \expIntegral \left (1, i f x +i e +\frac {i \left (c f -d e \right )}{d}\right )}{d}-\frac {a^{2} {\mathrm e}^{-\frac {i \left (c f -d e \right )}{d}} \expIntegral \left (1, -i f x -i e -\frac {i c f -i d e}{d}\right )}{d}+\frac {3 a^{2} \ln \left (d x +c \right )}{2 d}-\frac {a^{2} {\mathrm e}^{\frac {2 i \left (c f -d e \right )}{d}} \expIntegral \left (1, 2 i f x +2 i e +\frac {2 i \left (c f -d e \right )}{d}\right )}{4 d}-\frac {a^{2} {\mathrm e}^{-\frac {2 i \left (c f -d e \right )}{d}} \expIntegral \left (1, -2 i f x -2 i e -\frac {2 \left (i c f -i d e \right )}{d}\right )}{4 d}\) | \(216\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [C] Result contains complex when optimal does not.
time = 0.37, size = 361, normalized size = 2.49 \begin {gather*} \frac {\frac {4 \, a^{2} f \log \left (c + \frac {{\left (f x + e\right )} d}{f} - \frac {d e}{f}\right )}{d} - \frac {{\left (f {\left (E_{1}\left (\frac {2 \, {\left (-i \, {\left (f x + e\right )} d - i \, c f + i \, d e\right )}}{d}\right ) + E_{1}\left (-\frac {2 \, {\left (-i \, {\left (f x + e\right )} d - i \, c f + i \, d e\right )}}{d}\right )\right )} \cos \left (\frac {2 \, {\left (c f - d e\right )}}{d}\right ) - f {\left (i \, E_{1}\left (\frac {2 \, {\left (-i \, {\left (f x + e\right )} d - i \, c f + i \, d e\right )}}{d}\right ) - i \, E_{1}\left (-\frac {2 \, {\left (-i \, {\left (f x + e\right )} d - i \, c f + i \, d e\right )}}{d}\right )\right )} \sin \left (\frac {2 \, {\left (c f - d e\right )}}{d}\right ) - 2 \, f \log \left ({\left (f x + e\right )} d + c f - d e\right )\right )} a^{2}}{d} - \frac {4 \, {\left (f {\left (E_{1}\left (\frac {i \, {\left (f x + e\right )} d + i \, c f - i \, d e}{d}\right ) + E_{1}\left (-\frac {i \, {\left (f x + e\right )} d + i \, c f - i \, d e}{d}\right )\right )} \cos \left (\frac {c f - d e}{d}\right ) + f {\left (i \, E_{1}\left (\frac {i \, {\left (f x + e\right )} d + i \, c f - i \, d e}{d}\right ) - i \, E_{1}\left (-\frac {i \, {\left (f x + e\right )} d + i \, c f - i \, d e}{d}\right )\right )} \sin \left (\frac {c f - d e}{d}\right )\right )} a^{2}}{d}}{4 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.39, size = 191, normalized size = 1.32 \begin {gather*} -\frac {2 \, a^{2} \sin \left (-\frac {2 \, {\left (c f - d e\right )}}{d}\right ) \operatorname {Si}\left (\frac {2 \, {\left (d f x + c f\right )}}{d}\right ) + 8 \, a^{2} \sin \left (-\frac {c f - d e}{d}\right ) \operatorname {Si}\left (\frac {d f x + c f}{d}\right ) - 6 \, a^{2} \log \left (d x + c\right ) - 4 \, {\left (a^{2} \operatorname {Ci}\left (\frac {d f x + c f}{d}\right ) + a^{2} \operatorname {Ci}\left (-\frac {d f x + c f}{d}\right )\right )} \cos \left (-\frac {c f - d e}{d}\right ) - {\left (a^{2} \operatorname {Ci}\left (\frac {2 \, {\left (d f x + c f\right )}}{d}\right ) + a^{2} \operatorname {Ci}\left (-\frac {2 \, {\left (d f x + c f\right )}}{d}\right )\right )} \cos \left (-\frac {2 \, {\left (c f - d e\right )}}{d}\right )}{4 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} a^{2} \left (\int \frac {2 \cos {\left (e + f x \right )}}{c + d x}\, dx + \int \frac {\cos ^{2}{\left (e + f x \right )}}{c + d x}\, dx + \int \frac {1}{c + d x}\, dx\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [C] Result contains higher order function than in optimal. Order 9 vs. order
4.
time = 0.58, size = 6933, normalized size = 47.81 \begin {gather*} \text {Too large to display} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \frac {{\left (a+a\,\cos \left (e+f\,x\right )\right )}^2}{c+d\,x} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________